import java.util.*;

public class pokergame {
    static HashMap<Integer,String> hm = new HashMap<>();
    static ArrayList<Integer> list = new ArrayList<>();
    static {
        String [] color = {"♥","♦","♠","♣"};
        String [] number = {"3","4","5","6","7","8","9","10","J","Q","K","A","2"};
        int number1 = 1;
        for (String s : number) {
            for (String s1 : color) {
                 hm.put(number1,s1+s);
                 list.add(number1);
                 number1++;
            }
        }
        hm.put(number1,"小王");
        list.add(number1);
        number1++;
        hm.put(number1,"大王");
        list.add(number1);
    }//静态代码块，方法开始时只执行一次

    public  pokergame(){
        Collections.shuffle(list);
      TreeSet<Integer> play1 = new TreeSet<>();
      TreeSet<Integer> play2 = new TreeSet<>();
      TreeSet<Integer> play3 = new TreeSet<>();
      TreeSet<Integer> lord = new TreeSet<>();

        for (int i = 0; i < list.size(); i++) {
            if (i<=2){
                lord.add(list.get(i));
            }
            else if(i>2){
                if (i%3==0){
                    play1.add(list.get(i));
                }else if(i%3==1){
                    play2.add(list.get(i));
                }else if(i%3==2){
                    play3.add(list.get(i));
                }
            }
        }
        lookPoker("wang",play1);
        lookPoker("li",play2);
        lookPoker("zhao",play3);
        lookPoker("底牌",lord);
    }

  public void lookPoker(String name, TreeSet<Integer> ts){
      System.out.print(name+":");
      for (Integer t : ts) {
          String poker = hm.get(t);
          System.out.print(poker+" ");
      }
      System.out.println();
  }
}

